AdfUIComponents.createComponentClass("AdfUIMenuBar",{componentType:"oracle.adf.MenuBar",propertyKeys:[{name:"value",type:"Object",secured:!0}],superclass:AdfUIPanel}); AdfUIComponents.createComponentClass("AdfRichMenuBar",{componentType:"oracle.adf.RichMenuBar",propertyKeys:[{name:"inlineStyle",type:"String"},{name:"styleClass",type:"String"},{name:"shortDesc",type:"String"},{name:"unsecure",type:"Object",secured:!0},{name:"visible",type:"Boolean","default":!0},{name:"flex",type:"Number","default":0},{name:"stretchId",type:"String"},{name:"disabled",type:"Boolean","default":!1,secured:!0}],superclass:AdfUIMenuBar}); AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlMenuBarPeer",!1); AdfDhtmlMenuBarPeer.InitSubclass=function(){AdfObject.ensureClassInitialization(AdfToolbarUtils);AdfObject.ensureClassInitialization(AdfMenuUtils);this._sOpenedPopups=[];AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfUIInputEvent.KEY_PRESS_EVENT_TYPE,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.FOCUS_EVENT_TYPE,AdfUIInputEvent.BLUR_EVENT_TYPE);AdfAgent.AGENT.getCapabilities()[AdfAgent.CAP_TOUCH_SCREEN]==AdfAgent.CAP_TOUCH_SCREEN_NONE&& AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.MOUSE_IN_EVENT_TYPE,AdfUIInputEvent.MOUSE_OUT_EVENT_TYPE)}; AdfDhtmlMenuBarPeer.prototype.InitDomElement=function(a,b){AdfDhtmlMenuBarPeer.superclass.InitDomElement.call(this,a,b);var d=a.getClientId(),e=AdfRichUIPeer.CreateSubId(d,"eoc"),f=AdfAgent.AGENT;this._isOverflowSupported=(this._overflowContainer=f.getElementById(e))?!0:!1;!0==this._isOverflowSupported&&(e=AdfRichUIPeer.CreateSubId(d,"eoi"),this._overflowIndicator=f.getElementById(e),AdfPage.PAGE.__registerDescendantResizeNotifyComponent(a));d=b.getElementsByTagName("table")[0];this._childContainers= f.getTableRowCells(f.getTableRow(d,0));this._activeDescendant=AdfFocusUtils.setFirstActiveDescendant(b)};AdfDhtmlMenuBarPeer.prototype.needsChildVisibilityChanges=function(a){return!0};AdfDhtmlMenuBarPeer.prototype.needsResizeNotify=function(a){return!0};AdfDhtmlMenuBarPeer.prototype.getDescendantComponents=function(a,b){b||(b=[]);AdfDhtmlMenuBarPeer.superclass.getDescendantComponents.call(this,a,b);!0==this._isOverflowSupported&&AdfOverflowSupport.getOverflowChildComponents(a,b);return b}; AdfDhtmlMenuBarPeer.prototype.updateScrollIconsState=function(){};AdfDhtmlMenuBarPeer.prototype.resetActiveDescendant=function(){this._activeDescendant&&this._activeDescendant.setAttribute("tabIndex","-1");this._activeDescendant=AdfFocusUtils.setFirstActiveDescendant(this.getDomElement())}; AdfDhtmlMenuBarPeer.prototype.ResizeNotify=function(a,b,d,e){a=this.getDomElement();b=this.getComponent();d=b.getClientId();if(!1!=this._isOverflowSupported||b.getStretchId()){this._unStretch();if(!0==this._isOverflowSupported){if(!this._overflowSupport){this._overflowSupport=new AdfOverflowSupport(d,this,"end",null,null,!0);a=a.getElementsByTagName("table")[0];b=AdfAgent.AGENT;a=b.getTableRowCells(b.getTableRow(a,0));b=0;for(d=a[0];d;)this._overflowSupport.createStep(),this._overflowSupport.addElement(d), d=AdfDomUtils.getFirstChildElement(d),AdfToolbarUtils.isValidOverflowElement(d)&&(d=this._createOverflowElement(d),this._overflowSupport.addOverflowElement(d)),b++,d=a[b]}this._overflowSupport.handleResize()}this._reStretch();(!this._activeDescendant||!(0a&&(this._minimumWidth=a)}else this._minimumWidth= 0;return this._minimumWidth}; AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyDown=function(a){if(!a.isCanceled()){var b=AdfAgent.AGENT,d=a.getKeyCode(),e=a.getSource();e instanceof AdfRichCommandNavigationItem?(d==AdfKeyStroke.ESC_KEY&&e.getParent()instanceof AdfRichCommandNavigationItem&&(b=b.getElementById(e.getParent().getClientId()),AdfFocusUtils.focusFirstTabStop(b),AdfDhtmlMenuBarPeer.superclass.cancelAllPopups.call(this,e),AdfDhtmlMenuBarPeer.superclass.cancelAllPopups.call(this,e.getParent()),a.cancel()),this._handleArrowKeysForMenuModel(d, a)):b.getPreferredKeyEventForRepetition()==AdfUIInputEvent.KEY_DOWN_EVENT_TYPE&&this._handleArrowKeys(d,a)}};AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyPress=function(a){if(!a.isCanceled()&&AdfAgent.AGENT.getPreferredKeyEventForRepetition()==AdfUIInputEvent.KEY_PRESS_EVENT_TYPE){var b=a.getKeyCode();this._handleArrowKeys(b,a)}}; AdfDhtmlMenuBarPeer.prototype.HandleComponentKeyUp=function(a){var b=this.getComponent();if(!a.isCanceled()&&!b.getDisabled()){var d=a.getSource(),e=a.getKeyCode();if(d instanceof AdfRichCommandNavigationItem&&e==AdfKeyStroke.ENTER_KEY){var f=AdfAgent.AGENT,g=f.getElementById(d.getClientId()),e=g.getAttribute("href"),f=f.getDomDocument().location.href,h=f.indexOf("#"),f=-1==h?f:f.substring(0,h);e&&(-1==e.indexOf(f)||1>=AdfKeyStroke.SHIFT_MASK,d=AdfKeyStroke.getKeyStroke(d.getKeyCode(),e));for(var d=d.toMarshalledString().toUpperCase(),e=a.getClientId(),e=AdfAgent.AGENT.getElementById(e).getElementsByTagName("A"),f=e.length,g=0;gd.indexOf(a)||(d=d.substring(a.length+1),b=d.indexOf(":"),0=a-1?AdfDhtmlMenuPeer._sDetachedMenus[0]:AdfDhtmlMenuPeer._sDetachedMenus[b+1]));if(b=AdfPage.PAGE.findComponent(a)){var d=b.getPeer(); d.bind(b);(null==d._activeDescendant||!AdfFocusUtils.isFocusableDescendant(d._activeDescendant))&&d.resetActiveDescendant();AdfFocusUtils.focusElement(d._activeDescendant);AdfDhtmlMenuPeer._lastSelectedDetachableMenuId=a}else AdfDhtmlMenuPeer._removeFromDetachedMenus(a),AdfDhtmlMenuPeer._focusNextDetachedMenuKeyHandler()}}; AdfDhtmlMenuPeer._addToDetachedMenus=function(a){var b=AdfAgent.AGENT;if(AdfCollections.isEmpty(AdfDhtmlMenuPeer._sDetachedMenus)){if(b.getPlatform()==AdfAgent.GECKO_PLATFORM){var d=AdfPage.PAGE.getDomDocument();b.addBubbleEventListener(d,"keypress",AdfDhtmlMenuPeer._cancelKeyPress)}AdfPage.PAGE.registerKeyStroke(AdfDhtmlMenuPeer._focusDetachedMenuKeyStroke,AdfDhtmlMenuPeer._focusNextDetachedMenuKeyHandler)}0>AdfCollections.indexOf(AdfDhtmlMenuPeer._sDetachedMenus,a)&&(AdfDhtmlMenuPeer._lastSelectedDetachableMenuId= a,AdfDhtmlMenuPeer._sDetachedMenus.push(a))}; AdfDhtmlMenuPeer._removeFromDetachedMenus=function(a){AdfCollections.removeArrayValue(AdfDhtmlMenuPeer._sDetachedMenus,a);var b=AdfCollections.isEmpty(AdfDhtmlMenuPeer._sDetachedMenus);if(b||a==AdfDhtmlMenuPeer._lastSelectedDetachableMenuId)AdfDhtmlMenuPeer._lastSelectedDetachableMenuId=null;b&&(AdfPage.PAGE.unregisterKeyStroke(AdfDhtmlMenuPeer._focusDetachedMenuKeyStroke),a=AdfAgent.AGENT,a.getPlatform()==AdfAgent.GECKO_PLATFORM&&(b=AdfPage.PAGE.getDomDocument(),a.removeBubbleEventListener(b,"keypress", AdfDhtmlMenuPeer._cancelKeyPress)))};AdfDhtmlMenuPeer._cancelKeyPress=function(a){var b=AdfAgent.AGENT.getKeyCode(a);a.ctrlKey&&(a.shiftKey&&b==AdfKeyStroke.W_KEY)&&AdfAgent.AGENT.eatEvent(a)};AdfDhtmlMenuPeer._menuBarKeyHandler=function(a){AdfDhtmlMenuPeer._focusMenuBar()};AdfDhtmlMenuPeer._addBarMenu=function(a){var b=AdfDhtmlMenuPeer._sBarMenus;0==b.length&&AdfPage.PAGE.registerKeyStroke(AdfDhtmlMenuPeer._menuBarKeyStroke,AdfDhtmlMenuPeer._menuBarKeyHandler);b.push(a)}; AdfDhtmlMenuPeer._removeBarMenu=function(a){var b=AdfDhtmlMenuPeer._sBarMenus;AdfCollections.removeArrayValue(b,a);0==b.length&&AdfPage.PAGE.unregisterKeyStroke(AdfDhtmlMenuPeer._menuBarKeyStroke)};AdfDhtmlMenuPeer._focusMenuBar=function(){var a=AdfDhtmlMenuPeer._sBarMenus;AdfAssert.assert(1>=AdfKeyStroke.SHIFT_MASK,d=AdfKeyStroke.getKeyStroke(d.getKeyCode(),e));for(var d=d.toMarshalledString().toUpperCase(),e=a.getElementsByTagName("tr"),f=e.length,g=0;gthis._maxDisplayItems)e=AdfRichUIPeer.CreateSubId(b,"ScrollUp"),this._scrollUpElement=a.getElementById(e),this._scrollUpElement.style.display="block", e=AdfRichUIPeer.CreateSubId(b,"sUpBg"),this._scrollUpBackgroundElement=a.getElementById(e),e=AdfRichUIPeer.CreateSubId(b,"ScrollDown"),this._scrollDownElement=a.getElementById(e),this._scrollDownElement.style.display="block",e=AdfRichUIPeer.CreateSubId(b,"sDwnBg"),this._scrollDownBackgroundElement=a.getElementById(e),b=AdfRichUIPeer.CreateSubId(b,"ScrollBox"),this._scrollBoxElement=a.getElementById(b),this._scrollBoxElement.style.height=d[this._maxDisplayItems].offsetTop-2-d[0].offsetTop+"px"}}; AdfDhtmlMenuPeer.prototype._createMenuPopupHints=function(a,b){var d={},e=this.getDomElement(),f=this.getComponent();d[AdfDhtmlPopupHints.TYPE]=AdfDhtmlPopupHints.TYPE_MENU;d[AdfDhtmlPopupHints.AUTODISMISS]=AdfDhtmlPopupHints.AUTODISMISS_MENU;d[AdfDhtmlPopupHints.ALIGN_ELEMENT]=e;d[AdfDhtmlPopupHints.FOCUS]=b?!0:!1;var g=f.getText();null==g&&(g=f.getShortDesc());d[AdfDhtmlPopupHints.TITLE]=g;d[AdfDhtmlPopupHints.ANIMATE]=AdfRichPopup.ANIMATE_DEFAULT;d[AdfDhtmlPopupHints.CLOSE_ON_ESCAPE]=!1;if(null== a||null==a[AdfDhtmlPopupHints.MOUSEPOSITION])this._isSubMenu()||AdfMenuUtils.isInOverflow(e)?d[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_END_BEFORE:d[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_AFTER_START;AdfCollections.copyInto(d,a);return d}; AdfDhtmlMenuPeer.prototype._showFetchingDataPopup=function(){var a=AdfAgent.AGENT,b=this.getComponent(),d=this.getDomElement().getAttribute("id"),d=AdfRichUIPeer.CreateSubId(d,"lazy-fetch-message"),a=a.getElementById(d),a=AdfDomUtils.getFirstChildElement(a),e=this._createMenuPopupHints(null,!1);e[AdfDhtmlPopupHints.TYPE]=AdfDhtmlPopupHints.TYPE_INLINESELECTOR;AdfDomUtils.setVisible(a,!0);AdfDhtmlMenuPeer.superclass.showPopup.call(this,b,a,e,d)}; AdfDhtmlMenuPeer.prototype._hideFetchingDataPopup=function(){var a=this.getComponent(),b=this.getDomElement().getAttribute("id"),b=AdfRichUIPeer.CreateSubId(b,"lazy-fetch-message");AdfDhtmlMenuPeer.superclass.hidePopup.call(this,a,b)}; AdfDhtmlMenuPeer.prototype._reattachMenu=function(){if(this.isDetached()){var a=this.getComponent().getClientId();AdfDhtmlMenuPeer._reattachedMenuId=a;AdfMenuUtils.addOpenMenu(a);AdfDhtmlMenuPeer._removeFromDetachedMenus(a);this._showShadow(!1);a=this._calculateReattachPosition();this._isDetached=!1;if(AdfPage.PAGE.isAnimationEnabled())this._animateReattach({left:a.x,top:a.y});else{this._moveShadow(!0);var b=this._getMenuPopup();b&&b.setAlignPosition(a);AdfDomUtils.removeCSSClassName(this._getMenuElement(), AdfMenuUtils.DETACHED_STYLE_CLASS)}}};AdfDhtmlMenuPeer.prototype._animateReattach=function(a){AdfDomUtils.removeCSSClassName(this._getMenuElement(),AdfMenuUtils.DETACHED_STYLE_CLASS);var b=this._detachableWindow.getElement();AdfDhtmlElementAnimator.animate(AdfDhtmlElementAnimator.FRAME_METHOD_SLOW_FAST_SLOW,300,[{element:b,properties:a}],null,AdfDhtmlMenuPeer._animateReattachComplete,[this,a.y,a.x])}; AdfDhtmlMenuPeer._animateReattachComplete=function(a){var b=a[0],d=a[1];a=a[2];b._moveShadow(!0);d={y:d,x:a};(b=b._getMenuPopup())&&b.setAlignPosition(d)};AdfDhtmlMenuPeer.prototype._calculateReattachPosition=function(){var a=AdfPage.PAGE.getPositionManager(),b=this.getDomElement(),d=this._getMenuElement(),e=AdfRichPopup.ALIGN_END_BEFORE,f=d.clientHeight-4,d=d.clientWidth+AdfDhtmlShadowDecorator.getShadowSize();return a.calculatePlacementPosition(f,d,e,b,null)}; AdfDhtmlMenuPeer.prototype._contains=function(a){var b=this.getDomElement(),b=AdfDomUtils.isAncestorOrSelf(b,a);if("noContent"==this._getLazyState())return b;a=AdfDomUtils.isAncestor(this._getMenuElement(),a);return b||a};AdfDhtmlMenuPeer.prototype._getParentId=function(){if(!this._parentId){var a=this.getDomElement().parentNode;do var b=a.getAttribute("id"),a=a.parentNode;while(!b&&a);b&&(this._parentId=b)}return this._parentId}; AdfDhtmlMenuPeer.prototype._getDepth=function(){if(!this._depth){var a=this.getDomElement();this._depth=parseInt(a.getAttribute(AdfMenuUtils.MENU_DEPTH_KEY))}return this._depth};AdfDhtmlMenuPeer.prototype._isSubMenu=function(){return 1this._scrollDelta)for(var e=d-1;-1=d)){this._scrollBoxElement.scrollTop=d;break}}else for(var g=a+this._scrollBoxElement.offsetHeight,e=0;e=a||a>=b)&&this._endScroll();this.updateScrollIconsState()};AdfDhtmlMenuPeer.prototype._getMenuElement=function(){if(null==this._menuElement){var a=this.getDomElement().getAttribute("id"),a=AdfRichUIPeer.CreateSubId(a,"menu");this._menuElement=AdfAgent.AGENT.getElementById(a)}return this._menuElement}; AdfDhtmlMenuPeer.prototype._getMenuPopup=function(){var a=this.getComponent(),b=a.getClientId();return this.getPopupWindow(a,b)};AdfDhtmlMenuPeer.prototype._isMenuVisible=function(){return this._getMenuPopup()?!0:!1};AdfDhtmlMenuPeer.prototype.isContentLoaded=function(){return null!=this._lazyState&&"contentLoaded"==this._lazyState};AdfDhtmlMenuPeer.prototype._getLazyState=function(){null==this._lazyState&&(this._lazyState=null==this._getMenuElement()?"noContent":"contentLoaded");return this._lazyState}; AdfDhtmlMenuPeer.prototype._setLazyState=function(a){this._lazyState=a};AdfDhtmlMenuPeer.prototype._updateActiveDescendant=function(a){AdfAssert.assertDomElement(a);this._activeDescendant&&this._activeDescendant.setAttribute("tabIndex","-1");a.setAttribute("tabIndex","0");this._activeDescendant=a};AdfDhtmlMenuPeer.prototype.SimulateMouseOnDescendant=function(a,b,d){AdfDhtmlMenuPeer.superclass.SimulateMouseOnDescendant.call(this,a,b,d);this.isContextMenu()||this._isMenuVisible()||this.show(null,!1)}; AdfUIComponents.createComponentClass("AdfRichCommandMenuItem",{componentType:"oracle.adf.RichCommandMenuItem",propertyKeys:[{name:"text",type:"String"},{name:"disabled",type:"Boolean","default":!1,secured:!0},{name:"accessKey",type:"String"},{name:"partialSubmit",type:"Boolean","default":!0},{name:"icon",type:"String"},{name:"selected",type:"Boolean","default":!1},{name:"selectedText",type:"String"},{name:"type",type:"String"},"accelerator",{name:"inlineStyle",type:"String"},{name:"styleClass",type:"String"}, {name:"shortDesc",type:"String"},{name:"unsecure",type:"Object",secured:!0},{name:"visible",type:"Boolean","default":!0},{name:"useWindow",type:"Boolean","default":!1},{name:"windowModalityType",type:"String","default":"modeless"},{name:"windowEmbedStyle",type:"String","default":"window"},{name:"windowHeight",type:"Number"},{name:"windowWidth",type:"Number"}],superclass:AdfUICommand}); AdfRichCommandMenuItem.prototype.getCurrentText=function(){return"antonym"!=this.getType()?this.getText():this.getSelected()?this.getSelectedText():this.getText()};AdfRichCommandMenuItem.prototype.GetChanges=function(){var a=AdfRichCommandMenuItem.superclass.GetChanges.call(this),b=a[AdfRichCommandMenuItem.ACCELERATOR];b&&(a[AdfRichCommandMenuItem.ACCELERATOR]=b.toMarshalledString());return a}; AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlCommandMenuItemPeer"); AdfDhtmlCommandMenuItemPeer.InitSubclass=function(){AdfObject.ensureClassInitialization(AdfRichCommandMenuItem);AdfObject.ensureClassInitialization(AdfMenuUtils);AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.MOUSE_DOWN_EVENT_TYPE,AdfUIInputEvent.MOUSE_UP_EVENT_TYPE,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.FOCUS_EVENT_TYPE,AdfUIInputEvent.BLUR_EVENT_TYPE,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE);AdfAgent.AGENT.getCapabilities()[AdfAgent.CAP_TOUCH_SCREEN]== AdfAgent.CAP_TOUCH_SCREEN_NONE&&AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.MOUSE_IN_EVENT_TYPE,AdfUIInputEvent.MOUSE_OUT_EVENT_TYPE);AdfRichUIPeer.addComponentPropertyChanges(this,AdfRichCommandMenuItem.DISABLED,AdfRichCommandMenuItem.SELECTED,AdfRichCommandMenuItem.VISIBLE);AdfRichUIPeer.addComponentPropertyGetters(this,AdfRichCommandMenuItem.TEXT);this._AFR_GROUPID="_afrGrp";this._BUSY="_busy"}; AdfDhtmlCommandMenuItemPeer.prototype.Init=function(a){a.getParent();AdfDhtmlCommandMenuItemPeer.superclass.Init.call(this,a);this._spaceKeyDown=this._enterKeyDown=!1};AdfDhtmlCommandMenuItemPeer.prototype.InitDomElement=function(a,b){AdfDhtmlCommandMenuItemPeer.superclass.InitDomElement.call(this,a,b);var d=a.getAccelerator();null!=d&&AdfRichUIPeer.registerKeyStroke(a,d,this._execute)}; AdfDhtmlCommandMenuItemPeer.prototype.ComponentRemoved=function(a){var b=a.getAccelerator();null!=b&&AdfRichUIPeer.unregisterKeyStroke(a,b);AdfDhtmlCommandMenuItemPeer.superclass.ComponentRemoved.call(this,a)};AdfDhtmlCommandMenuItemPeer.prototype.GetAccessibleName=function(){return this.getComponent().getText()}; AdfDhtmlCommandMenuItemPeer.prototype.GetComponentText=function(a,b){var d=a.getParent();if(d=window.AdfRichMenu&&d instanceof AdfRichMenu?AdfDomUtils.getChildElements(b)[1]:AdfDomUtils.getFirstDescendentElement(b,"a"))if("antonym"==a.getType()&&(d=AdfDomUtils.getFirstChildElement(d)),d)return d=AdfAgent.AGENT.getTextContent(d),""==d?null:d;AdfAssert.assert(!1,"Unable to find the element containing the text")}; AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentKeyUp=function(a){var b=a.getNativeEvent();if(!b.ctrlKey){var d=AdfAgent.AGENT.getKeyCode(b),b=this.getComponent(),e=b.getProperty(AdfDhtmlCommandMenuItemPeer._BUSY);switch(d){case AdfKeyStroke.ENTER_KEY:this._enterKeyDown&&!e&&this._execute();this._enterKeyDown=!1;d=!0;break;case AdfKeyStroke.SPACE_KEY:this._spaceKeyDown&&!e&&this._execute();this._spaceKeyDown=!1;d=!0;break;default:return}d&&a.cancel();(a=b.getParent())&&a instanceof AdfRichMenu&& a.getPeer().updateScrollIconsState()}};AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentKeyDown=function(a){if(!a.isCanceled()&&!this._isDisabled()){var b=a.getKeyCode();b==AdfKeyStroke.ENTER_KEY?(this._enterKeyDown=!0,a.cancel(),a.stopBubbling()):b==AdfKeyStroke.SPACE_KEY&&(this._spaceKeyDown=!0,a.cancel(),a.stopBubbling())}}; AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentFocus=function(a){if(!this._isDisabled()){a.cancel();a=this.getDomElement();AdfDhtmlMenuPeer.cancelShowing();var b=this.getComponent();AdfMenuUtils.isInMenu(b)?AdfDomUtils.addCSSClassName(a,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS):(AdfMenuUtils.isMenuBarAutoOpenMode()&&AdfMenuUtils.closeAllMenus(!1),AdfMenuUtils.highlightRootMenuItem(a))}}; AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentMouseDown=function(a){!this._isDisabled()&&a.isLeftButtonPressed()&&(a=this.getDomElement(),AdfDomUtils.addCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS))};AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentMouseUp=function(a){!this._isDisabled()&&a.isLeftButtonPressed()&&(a=this.getDomElement(),AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS))}; AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentMouseOver=function(a){var b=this.getComponent();if(this._isDisabled())AdfMenuUtils.isMenuBarAutoOpenMode()&&AdfMenuUtils.isOnMenuBar(b)&&AdfMenuUtils.closeAllMenus(!1);else{a.cancel();a=this.getDomElement();var d=AdfFocusUtils.containsFocus(a);AdfMenuUtils.isInMenu(b)?(AdfDomUtils.addCSSClassName(a,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS),AdfMenuUtils.dismiss(a,!1),d||this.focus(b)):AdfMenuUtils.isMenuBarAutoOpenMode()&&!d?this.focus(b):AdfMenuUtils.highlightRootMenuItem(a)}}; AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentMouseOut=function(a){a.cancel();AdfMenuUtils.unhighlightRootMenuItem();this._isDisabled()||(a=this.getComponent(),AdfMenuUtils.isInMenu(a)&&this._deselectElement(),a=this.getDomElement(),AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.DEPRESSED_STYLE_CLASS))};AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentBlur=function(a){this._deselectElement()}; AdfDhtmlCommandMenuItemPeer.prototype.HandleComponentClick=function(a){var b=this.getComponent().getProperty(AdfDhtmlCommandMenuItemPeer._BUSY);a.isLeftButtonPressed()&&(!this._isDisabled()&&!b)&&this._execute();a.cancel()};AdfDhtmlCommandMenuItemPeer.prototype.ComponentDisabledChanged=function(a,b,d,e){AdfMenuUtils.menuItemDisabledChanged(a,b,d)}; AdfDhtmlCommandMenuItemPeer.prototype.ComponentSelectedChanged=function(a,b,d,e){e=a.getType();if("check"==e||"radio"==e)(AdfMenuUtils.isInMenu(a)?b:AdfDomUtils.getFirstChildElement(b)).setAttribute("aria-checked",d?"true":"false");d?(AdfDomUtils.addCSSClassName(b,AdfMenuUtils.SELECTED_STYLE_CLASS),"radio"==e&&this._toggleRadioGroupItems()):AdfDomUtils.removeCSSClassName(b,AdfMenuUtils.SELECTED_STYLE_CLASS)}; AdfDhtmlCommandMenuItemPeer.prototype.ComponentVisibleChanged=function(a,b,d,e){AdfDhtmlCommandMenuItemPeer.superclass.ComponentVisibleChanged.call(this,a,b,d,e);AdfMenuUtils.menuItemVisibleChanged(a,b,d)}; AdfDhtmlCommandMenuItemPeer.prototype.SetBusy=function(a){var b=this.getComponent(),d=this.getDomElement(),e=AdfDomUtils.getFormElement(d);e&&(e=AdfDomUtils.isMultiPartForm(e),!b.getDisabled()&&(!e&&!AdfPage.PAGE.isAttachmentMode())&&(AdfDomUtils.addOrRemoveCSSClassName(a,d,AdfRichUIPeer.DISABLED_STYLECLASS),b.setProperty(AdfDhtmlCommandMenuItemPeer._BUSY,a,!1,AdfUIComponent.PROPAGATE_NEVER)))}; AdfDhtmlCommandMenuItemPeer.prototype.__preferredSizeChangeNotify=function(a){this.bind(a);a=this.getComponentParent(a);var b=null!=a?a.getPeer():null;b&&b.__preferredSizeChangeNotify&&b.__preferredSizeChangeNotify(a)}; AdfDhtmlCommandMenuItemPeer.prototype._execute=function(){if(!this._isDisabled()){AdfLogger.LOGGER.finest("menuBar auto open mode, set to OFF due to commandMenuItem execute");AdfMenuUtils.setMenuBarAutoOpenMode(!1);for(var a=this.getComponent(),b=a.getParent();b instanceof AdfRichMenu;)b=b.getParent();b instanceof AdfRichPopup?(AdfMenuUtils.closeAllMenus(!1),b.getPeer().hide(b)):(b=AdfMenuUtils.isInMenu(a),AdfMenuUtils.closeAllMenus(b));b=AdfMenuUtils.getContextMenuItemTargetAttrs(a);null!=b&&AdfMenuUtils.setContextMenuItemTargetAttrs(a, b);b=new AdfActionEvent(a);b.queue(a.getPartialSubmit());b.isCanceled()||(b=a.getType(),"check"==b||"antonym"==b?a.setSelected(!a.getSelected()):"radio"==b&&this._toggleRadioGroupItems())}}; AdfDhtmlCommandMenuItemPeer.prototype._toggleRadioGroupItems=function(){var a=this.getComponent(),b=this.getDomElement(),b=this._getGroupId(b);null==b?(AdfLogger.LOGGER.warning("Unexpected to have commandMenuItem without a group Id."),a.setSelected(!a.getSelected())):(AdfMenuUtils.isInMenu(a)?this._toggleMenuRadioGroupItems(b):AdfMenuUtils.isOnMenuBar(a)&&this._toggleMenuBarRadioGroupItems(b),a.setSelected(!0))}; AdfDhtmlCommandMenuItemPeer.prototype._toggleMenuRadioGroupItems=function(a){for(var b=this.getComponent(),d=this.getDomElement().parentNode.childNodes,e=0;ed.getVersion()?(AdfMenuUtils.closeAllMenus(!1),AdfPage.PAGE.__handleNavigation(b,a)):(AdfPage.PAGE.__handleNavigation(b,a),AdfMenuUtils.closeAllMenus(!1))}}};AdfDhtmlGoMenuItemPeer.prototype._deselectElement=function(){var a=this.getDomElement();AdfDomUtils.removeCSSClassName(a,AdfMenuUtils.HIGHLIGHTED_STYLE_CLASS)};AdfDhtmlGoMenuItemPeer.prototype._isDisabled=function(){var a=this.getDomElement();return a.disabled||AdfDomUtils.containsCSSClassName(a,AdfRichUIPeer.DISABLED_STYLECLASS)};